import request from '@/utils/request'
import config from '@/utils/config'
// config.BaseUrl 114
// config.real1Url 118

// sidebar - 设置接口

// 商品类型列表
export function getGoodsType(params) {
  return request({
    url: config.BaseUrl + '/category/query/page',
    method: 'get',
    params: params
  })
}

// 新增商品类型
export function addGoodsType(params) {
  return request({
    url: config.BaseUrl + '/category/add',
    method: 'post',
    data: params
  })
}

// 更新商品类型
export function updateGoodsType(params) {
  return request({
    url: config.BaseUrl + '/category/edit',
    method: 'post',
    data: params
  })
}

// ------------------ 退货原因设置 -------------------------
// ------------------ 退货原因设置 -------------------------
// ------------------ 退货原因设置 -------------------------

// { addRefundReason, getRefundReasonList, editRefundReason, statusRefundReason, delRefundReason }

// 新增退货原因
export function addRefundReason(params) {
  return request({
    url: config.BaseUrl + '/refund/reason/add',
    method: 'post',
    data: params
  })
}

// 退货原因分页查询
export function getRefundReasonList(params) {
  return request({
    url: config.BaseUrl + '/refund/reason/query/page',
    method: 'get',
    params: params
  })
}

// 编辑退货原因信息
export function editRefundReason(params) {
  return request({
    url: config.BaseUrl + '/refund/reason/edit/all',
    method: 'post',
    data: params
  })
}

// 退货原因启用、停用
export function statusRefundReason(params) {
  return request({
    url: config.BaseUrl + '/refund/reason/edit/status',
    method: 'post',
    data: params
  })
}

// 删除退货原因配置项
export function delRefundReason(params) {
  return request({
    url: config.BaseUrl + '/refund/reason/del',
    method: 'post',
    data: params
  })
}
